﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            
            
            OSC.NET.OSCTransmitter transmitter = new OSC.NET.OSCTransmitter("192.168.1.106", 8001);
            transmitter.Connect();
            OSC.NET.OSCBundle bundle = new OSC.NET.OSCBundle();



            OSC.NET.OSCMessage msg = new OSC.NET.OSCMessage("/message/test/1");
            msg.Append(-5);
            msg.Append(-1.23f);
            msg.Append("msg1");

            OSC.NET.OSCMessage msg1 = new OSC.NET.OSCMessage("/message/*/2");
            msg1.Append(5);
            msg1.Append(1.23f);
            msg1.Append("msg2");

            bundle.Append(msg);
            bundle.Append(msg1);

            while (true)
            {
                transmitter.Send(msg1);
                Thread.Sleep(5000);
            }


            
            //OSC.NET.OSCReceiver rec = new OSC.NET.OSCReceiver(8000);
            //rec.Connect();
            //while (true)
            //{
            //    var r = rec.Receive();
            //    Console.WriteLine(r.Address);
            //    foreach (var i in r.Values)
            //    {
            //        Console.WriteLine("- "+i);
            //    }
            //}
        }
    }
}
